"""
@version:
@filename : 作业
@author : liuhongjie
@projectname: day02
@time: 2022/08/11
"""

import requests
import re
url = "https://www.sanchuangedu.cn/"
url1 = "https://www.sanchuangedu.cn"
y = requests.get(url)
ret = re.findall(r"(?<=<img src=)\S+.png",y.text)
wet = re.findall(r"(?<=<img src=)\S+.jpg",y.text)
ret.append(wet[0])
print(ret)
x = 0
for i in ret:
    ret1 = url+i
    ret2 = requests.get(ret1)
    with open(f"img{x}.png","wb") as f:
        f.write(ret2.content)
        x = x+1

